#include<bits/stdc++.h>
using namespace std;

string s[105];

string reS = "<censored>";

int main() {

    int n;
    cin >> n;

    int cnt_ban = 0;
    int min_len = INT_MAX;

    getchar();
    for(int i = 1; i <= n; i++) {
        getline(cin, s[i]);
        min_len = min(min_len, (int)s[i].size());
    }

    int k;
    string t;
    cin >> k;

    getchar();
    getline(cin, t);

    int p = 0;
//    while(p + min_len <= t.size()) {
//        for(int i = 1; i <= n; i++) {
//            if(s[i] == t.substr(p, s[i].size())) {
//                t.replace(p, s[i].size(), "<censored>");
//                p += 9;	// "<censored>".size();
//                cnt_ban++;
//                break;
//            }
//        }
//        p++;
//    }


    for(int i = 1; i <= n; i++) {
        auto q = t.find(s[i]);

        while(q != string::npos) {
            t.replace(q, s[i].size(), "---");

            cnt_ban++;
            p = q + 3;
            q = t.find(s[i], p);
        }
    }


    if(cnt_ban < k) {
        while(1) {
            auto q = t.find("---");
            if(q == string::npos)
                break;
            t.replace(q, 3, reS);
        }
        cout << t << "\n";
    } else {
        cout << cnt_ban << "\n";
        cout << "He Xie Ni Quan Jia!\n";
    }

    return 0;
}
